<!--
 Copyright 2023 Google LLC

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<p>
  We're hosting a number of workshops where you can get hands-on experience writing Service Weaver apps with guidance from an instructor. Use the links below to sign up. All the workshop materials are also <a href="https://github.com/serviceweaver/workshops">available online</a>, so you can complete the workshop on your own.
<p>

<p>
  <em>Please reach out to us if you're interested in hosting a Service Weaver workshop in your city or institution!</em>
</p>

<table id="workshops" class="workshops-table"></table>

<script>
  document.addEventListener('DOMContentLoaded', () => {
    const JANUARY = 0;
    const FEBRUARY = 1;
    const MARCH = 2;
    const APRIL = 3;
    const MAY = 4;
    const JUNE = 5;
    const JULY = 6;
    const AUGUST = 7;
    const SEPTEMBER = 8;
    const OCTOBER = 9;
    const NOVEMBER = 10;
    const DECEMBER = 11;
    const items = [
      {
        date: new Date(2023, JUNE, 27),
        location: 'Berlin',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-berlin-golang-presents-service-weaver-workshop/">GDG Berlin Golang</a>',
      },
      {
        date: new Date(2023, JUNE, 30),
        location: 'Zurich',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-zurich-presents-service-weaver-workshop/">GDG Zurich</a>, <a href="https://www.meetup.com/zurich-gophers/events/294260278">Zurich Gophers</a>',
      },
      {
        date: new Date(2023, JULY, 27),
        location: 'San Francisco',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-san-francisco-presents-service-weaver-workshop-in-person/cohost-gdg-san-francisco">GDG San Francisco</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023072718">AICamp SF</a>',
      },
      {
        date: new Date(2023, AUGUST, 15),
        location: 'Dublin',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-dublin-presents-workshop-on-service-weaver-by-robert-grandl-google-dublin/">GDG Dublin</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023081510">AICamp Dublin</a>, <a href="https://www.meetup.com/dublin-go-meetup/">Dublin Go Meetup</a>',
      },
      {
        date: new Date(2023, AUGUST, 16),
        location: 'London',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-cloud-london-presents-workshop-on-service-weaver-by-robert-grandl-google-london/">GDG (Cloud) London</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023081610">AICamp London</a>',
      },
      {
        date: new Date(2023, AUGUST, 17),
        location: 'London',
        register: '<a href="https://www.gophercon.co.uk/unconference/">GopherCon UK</a>',
      },
      {
        date: new Date(2023, AUGUST, 17),
        location: 'Sunnyvale',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-silicon-valley-presents-service-weaver-workshop-in-person/">GDG Silicon Valley</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023081717">AICamp Silicon Valley</a>, <a href="https://www.meetup.com/go-silicon-valley/events/295305595/">Golang Silicon Valley</a>',
      },
      {
        date: new Date(2023, AUGUST, 18),
        location: 'Paris',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-paris-presents-workshop-on-service-weaver-by-robert-grandl-google-paris/">GDG Paris</a>, <a href="https://www.meetup.com/golang-paris/events/295133777/">Golang Paris</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023081809">AICamp Paris</a>',
      },
      {
        date: new Date(2023, SEPTEMBER, 13),
        location: 'Boston',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-cloud-boston-presents-service-weaver-workshop-at-google-cambridge/">GDG Cloud Boston</a>, <a href="https://www.meetup.com/bostongo/events/295454707/">Boston Golang</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023091314">AICamp Boston</a>',
      },
      {
        date: new Date(2023, SEPTEMBER, 14),
        location: 'New York City',
        register: '<a href="https://gdg.community.dev/events/details/google-gdg-nyc-presents-service-weaver-workshop-at-google-nyc/">GDG NYC</a>, <a href="https://www.meetup.com/golanguagenewyork/events/295341065">GolangNYC</a>, <a href="https://www.aicamp.ai/event/eventdetails/W2023091414">AICamp NYC</a>',
      },
      {
        date: new Date(2023, SEPTEMBER, 26),
        location: 'San Diego',
        register: '<a href="https://www.gophercon.com/agenda/session/1200016">GopherCon</a>',
      },
      {
        date: new Date(2023, NOVEMBER, 19),
        location: 'Florence',
        register: '<a href="https://golab.io/talks/modern-cloud-development-with-service-weaver">Golab</a>',
      },
    ];

    const table = document.getElementById('workshops');

    // Create table header row.
    const headerRow = document.createElement("tr")
    table.appendChild(headerRow)
    for (const key in items[0]) {
      const headerCell = document.createElement("th");
      headerCell.textContent = key.charAt(0).toUpperCase() + key.slice(1);
      headerRow.appendChild(headerCell);
    }

    // Create table data rows.
    const options = { year: 'numeric', month: 'long', day: 'numeric' };
    for (const item of items) {
      const itemRow = document.createElement("tr");
      table.appendChild(itemRow)

      const itemCellDate = document.createElement("td")
      itemCellDate.textContent = item.date.toLocaleDateString(undefined, options)
      itemRow.appendChild(itemCellDate)

      const itemCellLoc = document.createElement("td")
      itemCellLoc.textContent = item.location
      itemRow.appendChild(itemCellLoc)

      const itemCellLink = document.createElement("td")
      itemCellLink.innerHTML = item.register
      itemRow.appendChild(itemCellLink)
    }
  });
</script>

<h1>Partners</h1>

<div id="partners">
  <a href="https://gdg.community.dev/" class="partner_logo">
    <img src="assets/images/GDG_logo.png" alt="GDG logo">
  </a>
  <a href="https://www.aicamp.ai/" class="partner_logo">
    <img src="assets/images/aicamp_logo.png" alt="AI Camp logo">
  </a>
</div>
